Uses Process,List,DispProc;
var
	l:PList;
	i,t:longint;
	P:PProcess;
procedure proc;
far;
begin
	writeln('this is');
end;
function compare(const p1:pointer; const p2:pointer):boolean;
far;
var
	proc1:PProcess;
	proc2:PProcess;
begin
	proc1:=p1;
	proc2:=p2;
	compare:=(proc1^.get_id = proc2^.get_id);
end;
var
	MyProcess,
	MyProcess1:TPRocess;
begin
	writeln('size of TList: ',sizeof(TList));
	writeln('isze of TProcess', sizeof(TProcess));
	writeln('membloks before init: ', memAvail div 8);
	l:=new(PList, init(sizeof(TProcess)));
	writeln(l^.max_size);
	for i:=1 to 10 do 
		begin
			MyProcess.init(proc, i);
			l^.push_back(MyProcess);
		end;
	MyProcess.init(proc,5);
	MyProcess1.init(proc,155);
	l^.insert(l^.find_by_comparator(@MyProcess, compare), MyProcess1);
	while(not l^.empty) do
		begin
			if (l^.front(MyProcess1)) then
				writeln('pid:', MyProcess1.get_id);
			l^.pop_front;
		end;
end.